home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / IncrementalParameterUpdator.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-30  |  37.6 KB  |  877 lines  |  [TEXT/KAHL]

  1. /* IncrementalParameterUpdator.c */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*    Out Of Phase:  Digital Music Synthesis on General Purpose Computers    */
  5. /*    Copyright (C) 1994  Thomas R. Lawrence                                 */
  6. /*                                                                           */
  7. /*    This program is free software; you can redistribute it and/or modify   */
  8. /*    it under the terms of the GNU General Public License as published by   */
  9. /*    the Free Software Foundation; either version 2 of the License, or      */
  10. /*    (at your option) any later version.                                    */
  11. /*                                                                           */
  12. /*    This program is distributed in the hope that it will be useful,        */
  13. /*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
  14. /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
  15. /*    GNU General Public License for more details.                           */
  16. /*                                                                           */
  17. /*    You should have received a copy of the GNU General Public License      */
  18. /*    along with this program; if not, write to the Free Software            */
  19. /*    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
  20. /*                                                                           */
  21. /*    Thomas R. Lawrence can be reached at tomlaw@world.std.com.             */
  22. /*                                                                           */
  23. /*****************************************************************************/
  24.  
  25. #include "MiscInfo.h"
  26. #include "Audit.h"
  27. #include "Debug.h"
  28. #include "Definitions.h"
  29.  
  30. #define ShowMeIncrParamUpdateRec
  31. #define ShowMe_NoteObjectRec
  32. #include "IncrementalParameterUpdator.h"
  33. #include "PlayTrackInfoThang.h"
  34. #include "Memory.h"
  35. #include "TrackObject.h"
  36. #include "LinearTransition.h"
  37. #include "NoteObject.h"
  38. #include "TempoController.h"
  39.  
  40.  
  41. /* build a new incremental parameter updator */
  42. IncrParamUpdateRec*        NewInitializedParamUpdator(struct TrackObjectRec* Template,
  43.                                                 struct TempoControlRec* TempoControl)
  44.     {
  45.         IncrParamUpdateRec*    Updator;
  46.  
  47.         CheckPtrExistence(Template);
  48.  
  49.         Updator = (IncrParamUpdateRec*)AllocPtrCanFail(sizeof(IncrParamUpdateRec),
  50.             "IncrParamUpdateRec");
  51.         if (Updator == NIL)
  52.             {
  53.              FailurePoint1:
  54.                 return NIL;
  55.             }
  56.  
  57.         Updator->DefaultStereoPosition = Double2LargeBCD(
  58.             TrackObjectGetStereoPositioning(Template));
  59.         Updator->CurrentStereoPosition = Updator->DefaultStereoPosition;
  60.         Updator->StereoPositionChange = NewLinearTransition(0,0,1);
  61.         if (Updator->StereoPositionChange == NIL)
  62.             {
  63.              FailurePoint2:
  64.                 ReleasePtr((char*)Updator);
  65.                 goto FailurePoint1;
  66.             }
  67.         Updator->StereoPositionChangeCountdown = 0;
  68.  
  69.         Updator->DefaultVolume = Double2LargeBCD(TrackObjectGetOverallLoudness(Template));
  70.         Updator->CurrentVolume = Updator->DefaultVolume;
  71.         Updator->VolumeChange = NewLinearTransition(0,0,1);
  72.         if (Updator->VolumeChange == NIL)
  73.             {
  74.              FailurePoint3:
  75.                 DisposeLinearTransition(Updator->StereoPositionChange);
  76.                 goto FailurePoint2;
  77.             }
  78.         Updator->VolumeChangeCountdown = 0;
  79.  
  80.         Updator->DefaultReleasePoint1 = Double2LargeBCD(
  81.             TrackObjectGetReleasePoint1(Template));
  82.         Updator->CurrentReleasePoint1 = Updator->DefaultReleasePoint1;
  83.         Updator->ReleasePoint1Change = NewLinearTransition(0,0,1);
  84.         if (Updator->ReleasePoint1Change == NIL)
  85.             {
  86.              FailurePoint4:
  87.                 DisposeLinearTransition(Updator->VolumeChange);
  88.                 goto FailurePoint3;
  89.             }
  90.         Updator->ReleasePoint1ChangeCountdown = 0;
  91.         switch (TrackObjectGetReleasePoint1StartEndFlag(Template))
  92.             {
  93.                 default:
  94.                     EXECUTE(PRERR(ForceAbort,"NewInitializedParamUpdator:  bad value "
  95.                         "from TrackObjectGetReleasePoint1StartEndFlag"));
  96.                     break;
  97.                 case eRelease1FromStart:
  98.                     Updator->ReleasePoint1FromStart = True;
  99.                     break;
  100.                 case eRelease1FromEnd:
  101.                     Updator->ReleasePoint1FromStart = False;
  102.                     break;
  103.             }
  104.  
  105.         Updator->DefaultReleasePoint2 = Double2LargeBCD(
  106.             TrackObjectGetReleasePoint2(Template));
  107.         Updator->CurrentReleasePoint2 = Updator->DefaultReleasePoint2;
  108.         Updator->ReleasePoint2Change = NewLinearTransition(0,0,1);
  109.         if (Updator->ReleasePoint2Change == NIL)
  110.             {
  111.              FailurePoint5:
  112.                 DisposeLinearTransition(Updator->ReleasePoint1Change);
  113.                 goto FailurePoint4;
  114.             }
  115.         Updator->ReleasePoint2ChangeCountdown = 0;
  116.         switch (TrackObjectGetReleasePoint2StartEndFlag(Template))
  117.             {
  118.                 default:
  119.                     EXECUTE(PRERR(ForceAbort,"NewInitializedParamUpdator:  bad value "
  120.                         "from TrackObjectGetReleasePoint2StartEndFlag"));
  121.                     break;
  122.                 case eRelease2FromStart:
  123.                     Updator->ReleasePoint2FromStart = True;
  124.                     break;
  125.                 case eRelease2FromEnd:
  126.                     Updator->ReleasePoint2FromStart = False;
  127.                     break;
  128.             }
  129.  
  130.         Updator->DefaultAccent1 = Double2LargeBCD(TrackObjectGetAccent1(Template));
  131.         Updator->CurrentAccent1 = Updator->DefaultAccent1;
  132.         Updator->Accent1Change = NewLinearTransition(0,0,1);
  133.         if (Updator->Accent1Change == NIL)
  134.             {
  135.              FailurePoint6:
  136.                 DisposeLinearTransition(Updator->ReleasePoint2Change);
  137.                 goto FailurePoint5;
  138.             }
  139.         Updator->Accent1ChangeCountdown = 0;
  140.  
  141.         Updator->DefaultAccent2 = Double2LargeBCD(TrackObjectGetAccent2(Template));
  142.         Updator->CurrentAccent2 = Updator->DefaultAccent2;
  143.         Updator->Accent2Change = NewLinearTransition(0,0,1);
  144.         if (Updator->Accent2Change == NIL)
  145.             {
  146.              FailurePoint7:
  147.                 DisposeLinearTransition(Updator->Accent1Change);
  148.                 goto FailurePoint6;
  149.             }
  150.         Updator->Accent2ChangeCountdown = 0;
  151.  
  152.         Updator->DefaultAccent3 = Double2LargeBCD(TrackObjectGetAccent3(Template));
  153.         Updator->CurrentAccent3 = Updator->DefaultAccent3;
  154.         Updator->Accent3Change = NewLinearTransition(0,0,1);
  155.         if (Updator->Accent3Change == NIL)
  156.             {
  157.              FailurePoint8:
  158.                 DisposeLinearTransition(Updator->Accent2Change);
  159.                 goto FailurePoint7;
  160.             }
  161.         Updator->Accent3ChangeCountdown = 0;
  162.  
  163.         Updator->DefaultAccent4 = Double2LargeBCD(TrackObjectGetAccent4(Template));
  164.         Updator->CurrentAccent4 = Updator->DefaultAccent4;
  165.         Updator->Accent4Change = NewLinearTransition(0,0,1);
  166.         if (Updator->Accent4Change == NIL)
  167.             {
  168.              FailurePoint9:
  169.                 DisposeLinearTransition(Updator->Accent3Change);
  170.                 goto FailurePoint8;
  171.             }
  172.         Updator->Accent4ChangeCountdown = 0;
  173.  
  174.         Updator->DefaultPitchDisplacementDepthLimit = Double2LargeBCD(
  175.             TrackObjectGetPitchDisplacementDepthAdjust(Template));
  176.         Updator->CurrentPitchDisplacementDepthLimit = Updator->DefaultPitchDisplacementDepthLimit;
  177.         Updator->PitchDisplacementDepthLimitChange = NewLinearTransition(0,0,1);
  178.         if (Updator->PitchDisplacementDepthLimitChange == NIL)
  179.             {
  180.              FailurePoint10:
  181.                 DisposeLinearTransition(Updator->Accent4Change);
  182.                 goto FailurePoint9;
  183.             }
  184.         Updator->PitchDisplacementDepthLimitChangeCountdown = 0;
  185.  
  186.         Updator->DefaultPitchDisplacementRateLimit = Double2LargeBCD(
  187.             TrackObjectGetPitchDisplacementRateAdjust(Template));
  188.         Updator->CurrentPitchDisplacementRateLimit = Updator->DefaultPitchDisplacementRateLimit;
  189.         Updator->PitchDisplacementRateLimitChange = NewLinearTransition(0,0,1);
  190.         if (Updator->PitchDisplacementRateLimitChange == NIL)
  191.             {
  192.              FailurePoint11:
  193.                 DisposeLinearTransition(Updator->PitchDisplacementDepthLimitChange);
  194.                 goto FailurePoint10;
  195.             }
  196.         Updator->PitchDisplacementRateLimitChangeCountdown = 0;
  197.  
  198.         Updator->DefaultPitchDisplacementStartPoint = Double2LargeBCD(
  199.             TrackObjectGetPitchDisplacementStartPoint(Template));
  200.         Updator->CurrentPitchDisplacementStartPoint = Updator->DefaultPitchDisplacementStartPoint;
  201.         Updator->PitchDisplacementStartPointChange = NewLinearTransition(0,0,1);
  202.         if (Updator->PitchDisplacementStartPointChange == NIL)
  203.             {
  204.              FailurePoint12:
  205.                 DisposeLinearTransition(Updator->PitchDisplacementRateLimitChange);
  206.                 goto FailurePoint11;
  207.             }
  208.         Updator->PitchDisplacementStartPointChangeCountdown = 0;
  209.         switch (TrackObjectGetPitchDisplacementFromStartOrEnd(Template))
  210.             {
  211.                 default:
  212.                     EXECUTE(PRERR(ForceAbort,"NewInitializedParamUpdator:  bad value "
  213.                         "from TrackObjectGetPitchDisplacementFromStartOrEnd"));
  214.                     break;
  215.                 case ePitchDisplacementStartFromStart:
  216.                     Updator->PitchDisplacementStartPointFromStart = True;
  217.                     break;
  218.                 case ePitchDisplacementStartFromEnd:
  219.                     Updator->PitchDisplacementStartPointFromStart = False;
  220.                     break;
  221.             }
  222.  
  223.         Updator->DefaultHurryUp = Double2LargeBCD(TrackObjectGetHurryUp(Template));
  224.         Updator->CurrentHurryUp = Updator->DefaultHurryUp;
  225.         Updator->HurryUpChange = NewLinearTransition(0,0,1);
  226.         if (Updator->HurryUpChange == NIL)
  227.             {
  228.              FailurePoint13:
  229.                 DisposeLinearTransition(Updator->PitchDisplacementStartPointChange);
  230.                 goto FailurePoint12;
  231.             }
  232.         Updator->HurryUpChangeCountdown = 0;
  233.  
  234.         Updator->DefaultDetune = Double2LargeBCD(TrackObjectGetDetune(Template));
  235.         Updator->CurrentDetune = Updator->DefaultDetune;
  236.         Updator->DetuneChange = NewLinearTransition(0,0,1);
  237.         if (Updator->DetuneChange == NIL)
  238.             {
  239.              FailurePoint14:
  240.                 DisposeLinearTransition(Updator->HurryUpChange);
  241.                 goto FailurePoint13;
  242.             }
  243.         Updator->DetuneChangeCountdown = 0;
  244.         switch (TrackObjectGetDetuneControlFlag(Template))
  245.             {
  246.                 default:
  247.                     EXECUTE(PRERR(ForceAbort,"NewInitializedParamUpdator:  bad value "
  248.                         "from TrackObjectGetDetuneControlFlag"));
  249.                     break;
  250.                 case eDetuningModeHalfSteps:
  251.                     Updator->DetuneHertz = False;
  252.                     break;
  253.                 case eDetuningModeHertz:
  254.                     Updator->DetuneHertz = True;
  255.                     break;
  256.             }
  257.  
  258.         Updator->DefaultEarlyLateAdjust = Double2LargeBCD(
  259.             TrackObjectGetEarlyLateAdjust(Template));
  260.         Updator->CurrentEarlyLateAdjust = Updator->DefaultEarlyLateAdjust;
  261.         Updator->EarlyLateAdjustChange = NewLinearTransition(0,0,1);
  262.         if (Updator->EarlyLateAdjustChange == NIL)
  263.             {
  264.              FailurePoint15:
  265.                 DisposeLinearTransition(Updator->DetuneChange);
  266.                 goto FailurePoint14;
  267.             }
  268.         Updator->EarlyLateAdjustChangeCountdown = 0;
  269.  
  270.         Updator->DefaultDurationAdjust = Double2LargeBCD(
  271.             TrackObjectGetDurationAdjust(Template));
  272.         Updator->CurrentDurationAdjust = Updator->DefaultDurationAdjust;
  273.         Updator->DurationAdjustChange = NewLinearTransition(0,0,1);
  274.         if (Updator->DurationAdjustChange == NIL)
  275.             {
  276.              FailurePoint16:
  277.                 DisposeLinearTransition(Updator->EarlyLateAdjustChange);
  278.                 goto FailurePoint15;
  279.             }
  280.         Updator->DurationAdjustChangeCountdown = 0;
  281.         switch (TrackObjectGetDurationModeFlag(Template))
  282.             {
  283.                 default:
  284.                     EXECUTE(PRERR(ForceAbort,"NewInitializedParamUpdator:  bad value "
  285.                         "from TrackObjectGetDurationModeFlag"));
  286.                     break;
  287.                 case eDurationAdjustAdditive:
  288.                     Updator->DurationAdjustAdditive = True;
  289.                     break;
  290.                 case eDurationAdjustMultiplicative:
  291.                     Updator->DurationAdjustAdditive = False;
  292.                     break;
  293.             }
  294.  
  295.         Updator->DefaultSurroundPosition = Double2LargeBCD(
  296.             TrackObjectGetSurroundPositioning(Template));
  297.         Updator->CurrentSurroundPosition = Updator->DefaultSurroundPosition;
  298.         Updator->SurroundPositionChange = NewLinearTransition(0,0,1);
  299.         if (Updator->SurroundPositionChange == NIL)
  300.             {
  301.              FailurePoint17:
  302.                 DisposeLinearTransition(Updator->DurationAdjustChange);
  303.                 goto FailurePoint16;
  304.             }
  305.  
  306.         Updator->TempoControl = TempoControl;
  307.  
  308.         Updator->TransposeHalfsteps = 0;
  309.  
  310.         return Updator;
  311.     }
  312.  
  313.  
  314. /* dispose of the incremental parameter updator */
  315. void                                    DisposeParamUpdator(IncrParamUpdateRec* Updator)
  316.     {
  317.         CheckPtrExistence(Updator);
  318.  
  319.         DisposeLinearTransition(Updator->StereoPositionChange);
  320.         DisposeLinearTransition(Updator->VolumeChange);
  321.         DisposeLinearTransition(Updator->ReleasePoint1Change);
  322.         DisposeLinearTransition(Updator->ReleasePoint2Change);
  323.         DisposeLinearTransition(Updator->Accent1Change);
  324.         DisposeLinearTransition(Updator->Accent2Change);
  325.         DisposeLinearTransition(Updator->Accent3Change);
  326.         DisposeLinearTransition(Updator->Accent4Change);
  327.         DisposeLinearTransition(Updator->PitchDisplacementDepthLimitChange);
  328.         DisposeLinearTransition(Updator->PitchDisplacementRateLimitChange);
  329.         DisposeLinearTransition(Updator->PitchDisplacementStartPointChange);
  330.         DisposeLinearTransition(Updator->HurryUpChange);
  331.         DisposeLinearTransition(Updator->DetuneChange);
  332.         DisposeLinearTransition(Updator->EarlyLateAdjustChange);
  333.         DisposeLinearTransition(Updator->DurationAdjustChange);
  334.         DisposeLinearTransition(Updator->SurroundPositionChange);
  335.  
  336.         ReleasePtr((char*)Updator);
  337.     }
  338.  
  339.  
  340. /* update a transition changer */
  341. void                                    UpdateOne(LargeBCDType* Current, LinearTransRec* Change,
  342.                                                 long* ChangeCountdown, long NumTicks)
  343.     {
  344.         if (NumTicks < *ChangeCountdown)
  345.             {
  346.                 *Current = LinearTransitionUpdateMultiple(Change,NumTicks);
  347.                 *ChangeCountdown -= NumTicks;
  348.             }
  349.         else if (*ChangeCountdown > 0)
  350.             {
  351.                 *Current = LinearTransitionUpdateMultiple(Change,*ChangeCountdown);
  352.                 *ChangeCountdown = 0;
  353.             }
  354.     }
  355.  
  356.  
  357. /* execute a series of update cycles.  the value passed in is the number of */
  358. /* duration ticks.  there are DURATIONUPDATECLOCKRESOLUTION (64*2*3*5*7) ticks */
  359. /* in a whole note */
  360. void                                    ExecuteParamUpdate(IncrParamUpdateRec* Updator, long NumTicks)
  361.     {
  362.         CheckPtrExistence(Updator);
  363.  
  364.         UpdateOne(&Updator->CurrentStereoPosition,Updator->StereoPositionChange,
  365.             &Updator->StereoPositionChangeCountdown,NumTicks);
  366.         UpdateOne(&Updator->CurrentVolume,Updator->VolumeChange,
  367.             &Updator->VolumeChangeCountdown,NumTicks);
  368.         UpdateOne(&Updator->CurrentReleasePoint1,Updator->ReleasePoint1Change,
  369.             &Updator->ReleasePoint1ChangeCountdown,NumTicks);
  370.         UpdateOne(&Updator->CurrentReleasePoint2,Updator->ReleasePoint2Change,
  371.             &Updator->ReleasePoint2ChangeCountdown,NumTicks);
  372.         UpdateOne(&Updator->CurrentAccent1,Updator->Accent1Change,
  373.             &Updator->Accent1ChangeCountdown,NumTicks);
  374.         UpdateOne(&Updator->CurrentAccent2,Updator->Accent2Change,
  375.             &Updator->Accent2ChangeCountdown,NumTicks);
  376.         UpdateOne(&Updator->CurrentAccent3,Updator->Accent3Change,
  377.             &Updator->Accent3ChangeCountdown,NumTicks);
  378.         UpdateOne(&Updator->CurrentAccent4,Updator->Accent4Change,
  379.             &Updator->Accent4ChangeCountdown,NumTicks);
  380.         UpdateOne(&Updator->CurrentPitchDisplacementDepthLimit,
  381.             Updator->PitchDisplacementDepthLimitChange,
  382.             &Updator->PitchDisplacementDepthLimitChangeCountdown,NumTicks);
  383.         UpdateOne(&Updator->CurrentPitchDisplacementRateLimit,
  384.             Updator->PitchDisplacementRateLimitChange,
  385.             &Updator->PitchDisplacementRateLimitChangeCountdown,NumTicks);
  386.         UpdateOne(&Updator->CurrentPitchDisplacementStartPoint,
  387.             Updator->PitchDisplacementStartPointChange,
  388.             &Updator->PitchDisplacementStartPointChangeCountdown,NumTicks);
  389.         UpdateOne(&Updator->CurrentHurryUp,Updator->HurryUpChange,
  390.             &Updator->HurryUpChangeCountdown,NumTicks);
  391.         UpdateOne(&Updator->CurrentDetune,Updator->DetuneChange,
  392.             &Updator->DetuneChangeCountdown,NumTicks);
  393.         UpdateOne(&Updator->CurrentEarlyLateAdjust,Updator->EarlyLateAdjustChange,
  394.             &Updator->EarlyLateAdjustChangeCountdown,NumTicks);
  395.         UpdateOne(&Updator->CurrentDurationAdjust,Updator->DurationAdjustChange,
  396.             &Updator->DurationAdjustChangeCountdown,NumTicks);
  397.         UpdateOne(&Updator->CurrentSurroundPosition,Updator->SurroundPositionChange,
  398.             &Updator->SurroundPositionChangeCountdown,NumTicks);
  399.     }
  400.  
  401.  
  402. /* sweep the value to a new value */
  403. void                                    SweepToNewValue(LargeBCDType Current,
  404.                                                 LinearTransRec* Change, long* ChangeCountdown,
  405.                                                 LargeBCDType TargetValue, SmallExtBCDType NumBeatsToReach)
  406.     {
  407.         *ChangeCountdown = SmallExtBCD2Double(NumBeatsToReach)
  408.             * (DURATIONUPDATECLOCKRESOLUTION / 4);
  409.         RefillLinearTransition(Change,Current,TargetValue,*ChangeCountdown);
  410.     }
  411.  
  412.  
  413. /* sweep to a new value relative to the current value */
  414. void                                    SweepToAdjustedValue(LargeBCDType Current,
  415.                                                 LinearTransRec* Change, long* ChangeCountdown,
  416.                                                 LargeBCDType TargetValue, SmallExtBCDType NumBeatsToReach)
  417.     {
  418.         *ChangeCountdown = SmallExtBCD2Double(NumBeatsToReach)
  419.             * (DURATIONUPDATECLOCKRESOLUTION / 4);
  420.         RefillLinearTransition(Change,Current,TargetValue + Current,*ChangeCountdown);
  421.     }
  422.  
  423.  
  424. /* sweep to a new value relative to the current value */
  425. void                                    SweepToAdjustedValueMultiplicatively(LargeBCDType Current,
  426.                                                 LinearTransRec* Change, long* ChangeCountdown,
  427.                                                 LargeBCDType TargetValue, SmallExtBCDType NumBeatsToReach)
  428.     {
  429.         *ChangeCountdown = SmallExtBCD2Double(NumBeatsToReach)
  430.             * (DURATIONUPDATECLOCKRESOLUTION / 4);
  431.         RefillLinearTransition(Change,Current,Double2LargeBCD(LargeBCD2Double(TargetValue)
  432.             * LargeBCD2Double(Current)),*ChangeCountdown);
  433.     }
  434.  
  435.  
  436. /* evaluate a command frame & set any parameters accordingly */
  437. void                                    ExecuteParamCommandFrame(IncrParamUpdateRec* Updator,
  438.                                                 struct NoteObjectRec* Note)
  439.     {
  440.         CheckPtrExistence(Updator);
  441.         CheckPtrExistence(Note);
  442.         ERROR(!IsItACommand(Note),PRERR(ForceAbort,
  443.             "ExecuteParamCommandFrame:  not a command frame"));
  444.  
  445.         switch (Note->Flags & ~eCommandFlag)
  446.             {
  447.                 default:
  448.                     EXECUTE(PRERR(ForceAbort,"ExecuteParamCommandFrame:  unknown command opcode"));
  449.                     break;
  450.  
  451.                 case eCmdRestoreTempo: /* restore the tempo to the default for the score */
  452.                     TempoControlRestoreDefault(Updator->TempoControl);
  453.                     break;
  454.                 case eCmdSetTempo: /* set tempo to <1xs> number of beats per second */
  455.                     TempoControlSetBeatsPerMinute(Updator->TempoControl,
  456.                         SmallExtBCD2LargeBCD(Note->a.Command.Argument1));
  457.                     break;
  458.                 case eCmdIncTempo: /* add <1xs> to the tempo control */
  459.                     TempoControlAdjustBeatsPerMinute(Updator->TempoControl,
  460.                         SmallExtBCD2LargeBCD(Note->a.Command.Argument1));
  461.                     break;
  462.                 case eCmdSweepTempoAbs: /* <1xs> = target tempo, <2xs> = # of beats to reach it */
  463.                     TempoControlSweepToNewValue(Updator->TempoControl,
  464.                         SmallExtBCD2LargeBCD(Note->a.Command.Argument1),Note->a.Command.Argument2);
  465.                     break;
  466.                 case eCmdSweepTempoRel: /* <1xs> = target adjust (add to tempo), <2xs> = # beats */
  467.                     TempoControlSweepToAdjustedValue(Updator->TempoControl,
  468.                         SmallExtBCD2LargeBCD(Note->a.Command.Argument1),Note->a.Command.Argument2);
  469.                     break;
  470.  
  471.                 case eCmdRestoreStereoPosition: /* restore stereo position to channel's default */
  472.                     Updator->CurrentStereoPosition = Updator->DefaultStereoPosition;
  473.                     Updator->StereoPositionChangeCountdown = 0;
  474.                     break;
  475.                 case eCmdSetStereoPosition: /* set position in channel <1l>: -1 = left, 1 = right */
  476.                     Updator->CurrentStereoPosition = Note->a.Command.Argument1;
  477.                     Updator->StereoPositionChangeCountdown = 0;
  478.                     break;
  479.                 case eCmdIncStereoPosition: /* adjust stereo position by adding <1l> */
  480.                     Updator->CurrentStereoPosition += Note->a.Command.Argument1;
  481.                     Updator->StereoPositionChangeCountdown = 0;
  482.                     break;
  483.                 case eCmdSweepStereoAbs: /* <1l> = new pos, <2xs> = # of beats to get there */
  484.                     SweepToNewValue(Updator->CurrentStereoPosition,Updator->StereoPositionChange,
  485.                         &Updator->StereoPositionChangeCountdown,Note->a.Command.Argument1,
  486.                         Note->a.Command.Argument2);
  487.                     break;
  488.                 case eCmdSweepStereoRel: /* <1l> = pos adjust, <2xs> = # beats to get there */
  489.                     SweepToAdjustedValue(Updator->CurrentStereoPosition,
  490.                         Updator->StereoPositionChange,&Updator->StereoPositionChangeCountdown,
  491.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  492.                     break;
  493.  
  494.                 case eCmdRestoreSurroundPosition: /* restore surround position to channel's default */
  495.                     Updator->CurrentSurroundPosition = Updator->DefaultSurroundPosition;
  496.                     Updator->SurroundPositionChangeCountdown = 0;
  497.                     break;
  498.                 case eCmdSetSurroundPosition: /* set position in channel <1l>: 1 = front, -1 = rear */
  499.                     Updator->CurrentSurroundPosition = Note->a.Command.Argument1;
  500.                     Updator->SurroundPositionChangeCountdown = 0;
  501.                     break;
  502.                 case eCmdIncSurroundPosition: /* adjust surround position by adding <1l> */
  503.                     Updator->CurrentSurroundPosition += Note->a.Command.Argument1;
  504.                     Updator->SurroundPositionChangeCountdown = 0;
  505.                     break;
  506.                 case eCmdSweepSurroundAbs: /* <1l> = new pos, <2xs> = # of beats to get there */
  507.                     SweepToNewValue(Updator->CurrentSurroundPosition,Updator->SurroundPositionChange,
  508.                         &Updator->SurroundPositionChangeCountdown,Note->a.Command.Argument1,
  509.                         Note->a.Command.Argument2);
  510.                     break;
  511.                 case eCmdSweepSurroundRel: /* <1l> = pos adjust, <2xs> = # beats to get there */
  512.                     SweepToAdjustedValue(Updator->CurrentSurroundPosition,
  513.                         Updator->SurroundPositionChange,&Updator->SurroundPositionChangeCountdown,
  514.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  515.                     break;
  516.  
  517.                 case eCmdRestoreVolume: /* restore the volume to the default for the channel */
  518.                     Updator->CurrentVolume = Updator->DefaultVolume;
  519.                     Updator->VolumeChangeCountdown = 0;
  520.                     break;
  521.                 case eCmdSetVolume: /* set the volume to the specified level (0..1) in <1l> */
  522.                     Updator->CurrentVolume = Note->a.Command.Argument1;
  523.                     Updator->VolumeChangeCountdown = 0;
  524.                     break;
  525.                 case eCmdIncVolume: /* multiply <1l> by the volume control */
  526.                     Updator->CurrentVolume = Double2LargeBCD(LargeBCD2Double(
  527.                         Note->a.Command.Argument1) * LargeBCD2Double(Updator->CurrentVolume));
  528.                     Updator->VolumeChangeCountdown = 0;
  529.                     break;
  530.                 case eCmdSweepVolumeAbs: /* <1l> = new volume, <2xs> = # of beats to reach it */
  531.                     SweepToNewValue(Updator->CurrentVolume,Updator->VolumeChange,
  532.                         &Updator->VolumeChangeCountdown,Note->a.Command.Argument1,
  533.                         Note->a.Command.Argument2);
  534.                     break;
  535.                 case eCmdSweepVolumeRel: /* <1l> = volume adjust, <2xs> = # of beats to reach it */
  536.                     SweepToAdjustedValueMultiplicatively(Updator->CurrentVolume,
  537.                         Updator->VolumeChange,&Updator->VolumeChangeCountdown,
  538.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  539.                     break;
  540.  
  541.                 case eCmdRestoreReleasePoint1: /* restore release point to master default */
  542.                     Updator->CurrentReleasePoint1 = Updator->DefaultReleasePoint1;
  543.                     Updator->ReleasePoint1ChangeCountdown = 0;
  544.                     break;
  545.                 case eCmdSetReleasePoint1: /* set the default release point to new value <1l> */
  546.                     Updator->CurrentReleasePoint1 = Note->a.Command.Argument1;
  547.                     Updator->ReleasePoint1ChangeCountdown = 0;
  548.                     break;
  549.                 case eCmdIncReleasePoint1: /* add <1l> to default release point for adjustment */
  550.                     Updator->CurrentReleasePoint1 += Note->a.Command.Argument1;
  551.                     Updator->ReleasePoint1ChangeCountdown = 0;
  552.                     break;
  553.                 case eCmdReleasePointOrigin1: /* <1i> -1 = from start, 0 = from end of note */
  554.                     Updator->ReleasePoint1FromStart = (Note->a.Command.Argument1 < 0);
  555.                     break;
  556.                 case eCmdSweepReleaseAbs1: /* <1l> = new release, <2xs> = # of beats to get there */
  557.                     SweepToNewValue(Updator->CurrentReleasePoint1,Updator->ReleasePoint1Change,
  558.                         &Updator->ReleasePoint1ChangeCountdown,Note->a.Command.Argument1,
  559.                         Note->a.Command.Argument2);
  560.                     break;
  561.                 case eCmdSweepReleaseRel1: /* <1l> = release adjust, <2xs> = # of beats to get there */
  562.                     SweepToAdjustedValue(Updator->CurrentReleasePoint1,
  563.                         Updator->ReleasePoint1Change,&Updator->ReleasePoint1ChangeCountdown,
  564.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  565.                     break;
  566.  
  567.                 case eCmdRestoreReleasePoint2: /* restore release point to master default */
  568.                     Updator->CurrentReleasePoint2 = Updator->DefaultReleasePoint2;
  569.                     Updator->ReleasePoint2ChangeCountdown = 0;
  570.                     break;
  571.                 case eCmdSetReleasePoint2: /* set the default release point to new value <1l> */
  572.                     Updator->CurrentReleasePoint2 = Note->a.Command.Argument1;
  573.                     Updator->ReleasePoint2ChangeCountdown = 0;
  574.                     break;
  575.                 case eCmdIncReleasePoint2: /* add <1l> to default release point for adjustment */
  576.                     Updator->CurrentReleasePoint2 += Note->a.Command.Argument1;
  577.                     Updator->ReleasePoint2ChangeCountdown = 0;
  578.                     break;
  579.                 case eCmdReleasePointOrigin2: /* <1i> -1 = from start, 0 = from end of note */
  580.                     Updator->ReleasePoint2FromStart = (Note->a.Command.Argument1 < 0);
  581.                     break;
  582.                 case eCmdSweepReleaseAbs2: /* <1l> = new release, <2xs> = # of beats to get there */
  583.                     SweepToNewValue(Updator->CurrentReleasePoint2,Updator->ReleasePoint2Change,
  584.                         &Updator->ReleasePoint2ChangeCountdown,Note->a.Command.Argument1,
  585.                         Note->a.Command.Argument2);
  586.                     break;
  587.                 case eCmdSweepReleaseRel2: /* <1l> = release adjust, <2xs> = # of beats to get there */
  588.                     SweepToAdjustedValue(Updator->CurrentReleasePoint2,
  589.                         Updator->ReleasePoint2Change,&Updator->ReleasePoint2ChangeCountdown,
  590.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  591.                     break;
  592.  
  593.                 case eCmdRestoreAccent1: /* restore accent value to master default */
  594.                     Updator->CurrentAccent1 = Updator->DefaultAccent1;
  595.                     Updator->Accent1ChangeCountdown = 0;
  596.                     break;
  597.                 case eCmdSetAccent1: /* specify the new default accent in <1l> */
  598.                     Updator->CurrentAccent1 = Note->a.Command.Argument1;
  599.                     Updator->Accent1ChangeCountdown = 0;
  600.                     break;
  601.                 case eCmdIncAccent1: /* add <1l> to the default accent */
  602.                     Updator->CurrentAccent1 += Note->a.Command.Argument1;
  603.                     Updator->Accent1ChangeCountdown = 0;
  604.                     break;
  605.                 case eCmdSweepAccentAbs1: /* <1l> = new accent, <2xs> = # of beats to get there */
  606.                     SweepToNewValue(Updator->CurrentAccent1,Updator->Accent1Change,
  607.                         &Updator->Accent1ChangeCountdown,Note->a.Command.Argument1,
  608.                         Note->a.Command.Argument2);
  609.                     break;
  610.                 case eCmdSweepAccentRel1: /* <1l> = accent adjust, <2xs> = # of beats to get there */
  611.                     SweepToAdjustedValue(Updator->CurrentAccent1,Updator->Accent1Change,
  612.                         &Updator->Accent1ChangeCountdown,Note->a.Command.Argument1,
  613.                         Note->a.Command.Argument2);
  614.                     break;
  615.  
  616.                 case eCmdRestoreAccent2: /* restore accent value to master default */
  617.                     Updator->CurrentAccent2 = Updator->DefaultAccent2;
  618.                     Updator->Accent2ChangeCountdown = 0;
  619.                     break;
  620.                 case eCmdSetAccent2: /* specify the new default accent in <1l> */
  621.                     Updator->CurrentAccent2 = Note->a.Command.Argument1;
  622.                     Updator->Accent2ChangeCountdown = 0;
  623.                     break;
  624.                 case eCmdIncAccent2: /* add <1l> to the default accent */
  625.                     Updator->CurrentAccent2 += Note->a.Command.Argument1;
  626.                     Updator->Accent2ChangeCountdown = 0;
  627.                     break;
  628.                 case eCmdSweepAccentAbs2: /* <1l> = new accent, <2xs> = # of beats to get there */
  629.                     SweepToNewValue(Updator->CurrentAccent2,Updator->Accent2Change,
  630.                         &Updator->Accent2ChangeCountdown,Note->a.Command.Argument1,
  631.                         Note->a.Command.Argument2);
  632.                     break;
  633.                 case eCmdSweepAccentRel2: /* <1l> = accent adjust, <2xs> = # of beats to get there */
  634.                     SweepToAdjustedValue(Updator->CurrentAccent2,Updator->Accent2Change,
  635.                         &Updator->Accent2ChangeCountdown,Note->a.Command.Argument1,
  636.                         Note->a.Command.Argument2);
  637.                     break;
  638.  
  639.                 case eCmdRestoreAccent3: /* restore accent value to master default */
  640.                     Updator->CurrentAccent3 = Updator->DefaultAccent3;
  641.                     Updator->Accent3ChangeCountdown = 0;
  642.                     break;
  643.                 case eCmdSetAccent3: /* specify the new default accent in <1l> */
  644.                     Updator->CurrentAccent3 = Note->a.Command.Argument1;
  645.                     Updator->Accent3ChangeCountdown = 0;
  646.                     break;
  647.                 case eCmdIncAccent3: /* add <1l> to the default accent */
  648.                     Updator->CurrentAccent3 += Note->a.Command.Argument1;
  649.                     Updator->Accent3ChangeCountdown = 0;
  650.                     break;
  651.                 case eCmdSweepAccentAbs3: /* <1l> = new accent, <2xs> = # of beats to get there */
  652.                     SweepToNewValue(Updator->CurrentAccent3,Updator->Accent3Change,
  653.                         &Updator->Accent3ChangeCountdown,Note->a.Command.Argument1,
  654.                         Note->a.Command.Argument2);
  655.                     break;
  656.                 case eCmdSweepAccentRel3: /* <1l> = accent adjust, <2xs> = # of beats to get there */
  657.                     SweepToAdjustedValue(Updator->CurrentAccent3,Updator->Accent3Change,
  658.                         &Updator->Accent3ChangeCountdown,Note->a.Command.Argument1,
  659.                         Note->a.Command.Argument2);
  660.                     break;
  661.  
  662.                 case eCmdRestoreAccent4: /* restore accent value to master default */
  663.                     Updator->CurrentAccent4 = Updator->DefaultAccent4;
  664.                     Updator->Accent4ChangeCountdown = 0;
  665.                     break;
  666.                 case eCmdSetAccent4: /* specify the new default accent in <1l> */
  667.                     Updator->CurrentAccent4 = Note->a.Command.Argument1;
  668.                     Updator->Accent4ChangeCountdown = 0;
  669.                     break;
  670.                 case eCmdIncAccent4: /* add <1l> to the default accent */
  671.                     Updator->CurrentAccent4 += Note->a.Command.Argument1;
  672.                     Updator->Accent4ChangeCountdown = 0;
  673.                     break;
  674.                 case eCmdSweepAccentAbs4: /* <1l> = new accent, <2xs> = # of beats to get there */
  675.                     SweepToNewValue(Updator->CurrentAccent4,Updator->Accent4Change,
  676.                         &Updator->Accent4ChangeCountdown,Note->a.Command.Argument1,
  677.                         Note->a.Command.Argument2);
  678.                     break;
  679.                 case eCmdSweepAccentRel4: /* <1l> = accent adjust, <2xs> = # of beats to get there */
  680.                     SweepToAdjustedValue(Updator->CurrentAccent4,Updator->Accent4Change,
  681.                         &Updator->Accent4ChangeCountdown,Note->a.Command.Argument1,
  682.                         Note->a.Command.Argument2);
  683.                     break;
  684.  
  685.                 case eCmdRestorePitchDispDepth: /* restore max pitch disp depth value to default */
  686.                     Updator->CurrentPitchDisplacementDepthLimit = Updator->DefaultPitchDisplacementDepthLimit;
  687.                     Updator->PitchDisplacementDepthLimitChangeCountdown = 0;
  688.                     break;
  689.                 case eCmdSetPitchDispDepth: /* set new max pitch disp depth <1l> */
  690.                     Updator->CurrentPitchDisplacementDepthLimit = Note->a.Command.Argument1;
  691.                     Updator->PitchDisplacementDepthLimitChangeCountdown = 0;
  692.                     break;
  693.                 case eCmdIncPitchDispDepth: /* add <1l> to the default pitch disp depth */
  694.                     Updator->CurrentPitchDisplacementDepthLimit += Note->a.Command.Argument1;
  695.                     Updator->PitchDisplacementDepthLimitChangeCountdown = 0;
  696.                     break;
  697.                 case eCmdSweepPitchDispDepthAbs: /* <1l> = new depth, <2xs> = # of beats */
  698.                     SweepToNewValue(Updator->CurrentPitchDisplacementDepthLimit,
  699.                         Updator->PitchDisplacementDepthLimitChange,
  700.                         &Updator->PitchDisplacementDepthLimitChangeCountdown,
  701.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  702.                     break;
  703.                 case eCmdSweepPitchDispDepthRel: /* <1l> = depth adjust, <2xs> = # of beats */
  704.                     SweepToAdjustedValue(Updator->CurrentPitchDisplacementDepthLimit,
  705.                         Updator->PitchDisplacementDepthLimitChange,
  706.                         &Updator->PitchDisplacementDepthLimitChangeCountdown,
  707.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  708.                     break;
  709.  
  710.                 case eCmdRestorePitchDispRate: /* restore max pitch disp rate to the master default */
  711.                     Updator->CurrentPitchDisplacementRateLimit = Updator->DefaultPitchDisplacementRateLimit;
  712.                     Updator->PitchDisplacementRateLimitChangeCountdown = 0;
  713.                     break;
  714.                 case eCmdSetPitchDispRate: /* set new max pitch disp rate in seconds to <1l> */
  715.                     Updator->CurrentPitchDisplacementRateLimit = Note->a.Command.Argument1;
  716.                     Updator->PitchDisplacementRateLimitChangeCountdown = 0;
  717.                     break;
  718.                 case eCmdIncPitchDispRate: /* add <1l> to the default max pitch disp rate */
  719.                     Updator->CurrentPitchDisplacementRateLimit += Note->a.Command.Argument1;
  720.                     Updator->PitchDisplacementRateLimitChangeCountdown = 0;
  721.                     break;
  722.                 case eCmdSweepPitchDispRateAbs: /* <1l> = new rate, <2xs> = # of beats to get there */
  723.                     SweepToNewValue(Updator->CurrentPitchDisplacementRateLimit,
  724.                         Updator->PitchDisplacementRateLimitChange,
  725.                         &Updator->PitchDisplacementRateLimitChangeCountdown,
  726.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  727.                     break;
  728.                 case eCmdSweepPitchDispRateRel: /* <1l> = rate adjust, <2xs> = # of beats to get there */
  729.                     SweepToAdjustedValue(Updator->CurrentPitchDisplacementRateLimit,
  730.                         Updator->PitchDisplacementRateLimitChange,
  731.                         &Updator->PitchDisplacementRateLimitChangeCountdown,
  732.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  733.                     break;
  734.  
  735.                 case eCmdRestorePitchDispStart: /* restore pitch disp start point to default */
  736.                     Updator->CurrentPitchDisplacementStartPoint = Updator->DefaultPitchDisplacementStartPoint;
  737.                     Updator->PitchDisplacementStartPointChangeCountdown = 0;
  738.                     break;
  739.                 case eCmdSetPitchDispStart: /* set the start point to <1l> */
  740.                     Updator->CurrentPitchDisplacementStartPoint = Note->a.Command.Argument1;
  741.                     Updator->PitchDisplacementStartPointChangeCountdown = 0;
  742.                     break;
  743.                 case eCmdIncPitchDispStart: /* add <1l> to the pitch disp start point */
  744.                     Updator->CurrentPitchDisplacementStartPoint += Note->a.Command.Argument1;
  745.                     Updator->PitchDisplacementStartPointChangeCountdown = 0;
  746.                     break;
  747.                 case eCmdPitchDispStartOrigin: /* specify the origin, same as for release point <1i> */
  748.                     Updator->PitchDisplacementStartPointFromStart = (Note->a.Command.Argument1 < 0);
  749.                     break;
  750.                 case eCmdSweepPitchDispStartAbs: /* <1l> = new vib start, <2xs> = # of beats */
  751.                     SweepToNewValue(Updator->CurrentPitchDisplacementStartPoint,
  752.                         Updator->PitchDisplacementStartPointChange,
  753.                         &Updator->PitchDisplacementStartPointChangeCountdown,
  754.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  755.                     break;
  756.                 case eCmdSweepPitchDispStartRel: /* <1l> = vib adjust, <2xs> = # of beats */
  757.                     SweepToAdjustedValue(Updator->CurrentPitchDisplacementStartPoint,
  758.                         Updator->PitchDisplacementStartPointChange,
  759.                         &Updator->PitchDisplacementStartPointChangeCountdown,
  760.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  761.                     break;
  762.  
  763.                 case eCmdRestoreHurryUp: /* restore default hurryup factor */
  764.                     Updator->CurrentHurryUp = Updator->DefaultHurryUp;
  765.                     Updator->HurryUpChangeCountdown = 0;
  766.                     break;
  767.                 case eCmdSetHurryUp: /* set the hurryup factor to <1l> */
  768.                     Updator->CurrentHurryUp = Note->a.Command.Argument1;
  769.                     Updator->HurryUpChangeCountdown = 0;
  770.                     break;
  771.                 case eCmdIncHurryUp: /* multiply <1l> by the hurryup factor */
  772.                     Updator->CurrentHurryUp *= Note->a.Command.Argument1;
  773.                     Updator->HurryUpChangeCountdown = 0;
  774.                     break;
  775.                 case eCmdSweepHurryUpAbs: /* <1l> = new hurryup factor, <2xs> = # of beats */
  776.                     SweepToNewValue(Updator->CurrentHurryUp,Updator->HurryUpChange,
  777.                         &Updator->HurryUpChangeCountdown,Note->a.Command.Argument1,
  778.                         Note->a.Command.Argument2);
  779.                     break;
  780.                 case eCmdSweepHurryUpRel: /* <1l> = hurryup adjust, <2xs> = # of beats to get there */
  781.                     SweepToAdjustedValue(Updator->CurrentHurryUp,
  782.                         Updator->HurryUpChange,&Updator->HurryUpChangeCountdown,
  783.                         Note->a.Command.Argument1,Note->a.Command.Argument2);
  784.                     break;
  785.  
  786.                 case eCmdRestoreDetune: /* restore the default detune factor */
  787.                     Updator->CurrentDetune = Updator->DefaultDetune;
  788.                     Updator->DetuneChangeCountdown = 0;
  789.                     break;
  790.                 case eCmdSetDetune: /* set the detune factor to <1l> */
  791.                     Updator->CurrentDetune = Note->a.Command.Argument1;
  792.                     Updator->DetuneChangeCountdown = 0;
  793.                     break;
  794.                 case eCmdIncDetune: /* add <1l> to current detune factor */
  795.                     Updator->CurrentDetune += Note->a.Command.Argument1;
  796.                     Updator->DetuneChangeCountdown = 0;
  797.                     break;
  798.                 case eCmdDetuneMode: /* <1i>:  -1: Hertz, 0: half-steps */
  799.                     Updator->DetuneHertz = (Note->a.Command.Argument1 < 0);
  800.                     break;
  801.                 case eCmdSweepDetuneAbs: /* <1l> = new detune, <2xs> = # of beats */
  802.                     SweepToNewValue(Updator->CurrentDetune,Updator->DetuneChange,
  803.                         &Updator->DetuneChangeCountdown,Note->a.Command.Argument1,
  804.                         Note->a.Command.Argument2);
  805.                     break;
  806.                 case eCmdSweepDetuneRel: /* <1l> = detune adjust, <2xs> = # of beats */
  807.                     SweepToAdjustedValue(Updator->CurrentDetune,Updator->DetuneChange,
  808.                         &Updator->DetuneChangeCountdown,Note->a.Command.Argument1,
  809.                         Note->a.Command.Argument2);
  810.                     break;
  811.  
  812.                 case eCmdRestoreEarlyLateAdjust: /* restore the default early/late adjust value */
  813.                     Updator->CurrentEarlyLateAdjust = Updator->DefaultEarlyLateAdjust;
  814.                     Updator->EarlyLateAdjustChangeCountdown = 0;
  815.                     break;
  816.                 case eCmdSetEarlyLateAdjust: /* set the early/late adjust value to <1l> */
  817.                     Updator->CurrentEarlyLateAdjust = Note->a.Command.Argument1;
  818.                     Updator->EarlyLateAdjustChangeCountdown = 0;
  819.                     break;
  820.                 case eCmdIncEarlyLateAdjust: /* add <1l> to the current early/late adjust value */
  821.                     Updator->CurrentEarlyLateAdjust += Note->a.Command.Argument1;
  822.                     Updator->EarlyLateAdjustChangeCountdown = 0;
  823.                     break;
  824.                 case eCmdSweepEarlyLateAbs: /* <1l> = new early/late adjust, <2xs> = # of beats */
  825.                     SweepToNewValue(Updator->CurrentEarlyLateAdjust,Updator->EarlyLateAdjustChange,
  826.                         &Updator->EarlyLateAdjustChangeCountdown,Note->a.Command.Argument1,
  827.                         Note->a.Command.Argument2);
  828.                     break;
  829.                 case eCmdSweepEarlyLateRel: /* <1l> = early/late delta, <2xs> = # of beats to get there */
  830.                     SweepToAdjustedValue(Updator->CurrentEarlyLateAdjust,Updator->EarlyLateAdjustChange,
  831.                         &Updator->EarlyLateAdjustChangeCountdown,Note->a.Command.Argument1,
  832.                         Note->a.Command.Argument2);
  833.                     break;
  834.  
  835.                 case eCmdRestoreDurationAdjust: /* restore the default duration adjust value */
  836.                     Updator->CurrentDurationAdjust = Updator->DefaultDurationAdjust;
  837.                     Updator->DurationAdjustChangeCountdown = 0;
  838.                     break;
  839.                 case eCmdSetDurationAdjust: /* set duration adjust value to <1l> */
  840.                     Updator->CurrentDurationAdjust = Note->a.Command.Argument1;
  841.                     Updator->DurationAdjustChangeCountdown = 0;
  842.                     break;
  843.                 case eCmdIncDurationAdjust: /* add <1l> to the current duration adjust value */
  844.                     Updator->CurrentDurationAdjust += Note->a.Command.Argument1;
  845.                     Updator->DurationAdjustChangeCountdown = 0;
  846.                     break;
  847.                 case eCmdSweepDurationAbs: /* <1l> = new duration adjust, <2xs> = # of beats */
  848.                     SweepToNewValue(Updator->CurrentDurationAdjust,Updator->DurationAdjustChange,
  849.                         &Updator->DurationAdjustChangeCountdown,Note->a.Command.Argument1,
  850.                         Note->a.Command.Argument2);
  851.                     break;
  852.                 case eCmdSweepDurationRel: /* <1l> = duration adjust delta, <2xs> = # of beats */
  853.                     SweepToAdjustedValue(Updator->CurrentDurationAdjust,Updator->DurationAdjustChange,
  854.                         &Updator->DurationAdjustChangeCountdown,Note->a.Command.Argument1,
  855.                         Note->a.Command.Argument2);
  856.                     break;
  857.                 case eCmdDurationAdjustMode: /* <1i>:  -1: Multiplicative, 0: Additive */
  858.                     Updator->DurationAdjustAdditive = (Note->a.Command.Argument1 >= 0);
  859.                     break;
  860.  
  861.                 case eCmdSetMeter: /* <1i> = numerator, <2i> = denominator */
  862.                     break;
  863.                 case eCmdSetMeasureNumber: /* <1i> = new number */
  864.                     break;
  865.  
  866.                 case eCmdSetTranspose: /* <1i> = new transpose value */
  867.                     Updator->TransposeHalfsteps = Note->a.Command.Argument1;
  868.                     break;
  869.                 case eCmdAdjustTranspose: /* <1i> = transpose adjustor */
  870.                     Updator->TransposeHalfsteps += Note->a.Command.Argument1;
  871.                     break;
  872.  
  873.                 case eCmdMarker: /* <string> holds the text */
  874.                     break;
  875.             }
  876.     }
  877.